# Linker should relocate monitor to this address
MONITOR_BASE := 0xE0100000
-# NB. '-Wstrict-prototypes -Wredundant-decls -Wpointer-arith -Winline -ansi'
-# might all be okay to add to Xen. '-Wnested-externs' is a maybe.
-# '-Wcast-qual' is evil.
+# NB. '-Wcast-qual' is nasty, so I omitted it.
CFLAGS := -fno-builtin -O3 -Wall -Ih/ -Wredundant-decls
CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline -ansi
Other internal utilities operating on mstates
*/
-#if __STD_C
static Void_t* sYSMALLOc(INTERNAL_SIZE_T, mstate);
+#ifndef MORECORE_CANNOT_TRIM
static int sYSTRIm(size_t, mstate);
+#endif
static void malloc_consolidate(mstate);
static Void_t** iALLOc(size_t, size_t*, int, Void_t**);
-#else
-static Void_t* sYSMALLOc();
-static int sYSTRIm();
-static void malloc_consolidate();
-static Void_t** iALLOc();
-#endif
/*
Debugging support
+#ifndef MORECORE_CANNOT_TRIM
/*
sYSTRIm is an inverse of sorts to sYSMALLOc. It gives memory back
to the system (via negative arguments to sbrk) if there is unused
}
return 0;
}
+#endif
/*
------------------------------ malloc ------------------------------
CFLAGS += -iwithprefix include -O3 -Wall -DMONITOR_BASE=$(MONITOR_BASE)
CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__ -DNDEBUG
#CFLAGS += -fomit-frame-pointer -I$(BASEDIR)/include -D__KERNEL__
+CFLAGS += -Wno-pointer-arith -Wredundant-decls
LDFLAGS := -T xeno.lds -N
#include <xeno/kernel.h>
#include <xeno/init.h>
#include <xeno/types.h>
-/*#include <xeno/stddef.h>*/
#include <xeno/slab.h>
#include <xeno/pci.h>
#include <asm/mpspec.h>
#include <asm/apic.h>
#include <asm/apicdef.h>
#include <asm/page.h>
-/*#include <asm/pgtable.h>*/
+#include <asm/io_apic.h>
#ifdef CONFIG_X86_IO_APIC
/* XXX Skip the Linux/BSD fast-trap vector! XXX */
if (current_vector == 0x80) goto next;
-#if 0
- if (current_vector == SYSCALL_VECTOR)
- goto next;
-#endif
-
if (current_vector > FIRST_SYSTEM_VECTOR) {
offset++;
current_vector = FIRST_DEVICE_VECTOR + offset;
}
extern void (*interrupt[NR_IRQS])(void);
-static struct hw_interrupt_type ioapic_level_irq_type;
-static struct hw_interrupt_type ioapic_edge_irq_type;
+
+/*
+ * Level and edge triggered IO-APIC interrupts need different handling,
+ * so we use two separate IRQ descriptors. Edge triggered IRQs can be
+ * handled with the level-triggered descriptor, but that one has slightly
+ * more overhead. Level-triggered interrupts cannot be handled with the
+ * edge-triggered handler, without risking IRQ storms and other ugly
+ * races.
+ */
+
+static unsigned int startup_edge_ioapic_irq(unsigned int irq);
+#define shutdown_edge_ioapic_irq disable_edge_ioapic_irq
+#define enable_edge_ioapic_irq unmask_IO_APIC_irq
+static void disable_edge_ioapic_irq (unsigned int irq);
+static void ack_edge_ioapic_irq(unsigned int irq);
+static void end_edge_ioapic_irq (unsigned int i);
+static struct hw_interrupt_type ioapic_edge_irq_type = {
+ "IO-APIC-edge",
+ startup_edge_ioapic_irq,
+ shutdown_edge_ioapic_irq,
+ enable_edge_ioapic_irq,
+ disable_edge_ioapic_irq,
+ ack_edge_ioapic_irq,
+ end_edge_ioapic_irq,
+ set_ioapic_affinity,
+};
+
+static unsigned int startup_level_ioapic_irq (unsigned int irq);
+#define shutdown_level_ioapic_irq mask_IO_APIC_irq
+#define enable_level_ioapic_irq unmask_IO_APIC_irq
+#define disable_level_ioapic_irq mask_IO_APIC_irq
+static void mask_and_ack_level_ioapic_irq (unsigned int irq);
+static void end_level_ioapic_irq (unsigned int irq);
+static struct hw_interrupt_type ioapic_level_irq_type = {
+ "IO-APIC-level",
+ startup_level_ioapic_irq,
+ shutdown_level_ioapic_irq,
+ enable_level_ioapic_irq,
+ disable_level_ioapic_irq,
+ mask_and_ack_level_ioapic_irq,
+ end_level_ioapic_irq,
+ set_ioapic_affinity,
+};
void __init setup_IO_APIC_irqs(void)
{
return 0;
}
-/*
- * In the SMP+IOAPIC case it might happen that there are an unspecified
- * number of pending IRQ events unhandled. These cases are very rare,
- * so we 'resend' these IRQs via IPIs, to the same CPU. It's much
- * better to do it this way as thus we do not have to be aware of
- * 'pending' interrupts in the IRQ path, except at this point.
- */
-/*
- * Edge triggered needs to resend any interrupt
- * that was delayed but this is now handled in the device
- * independent code.
- */
-#define enable_edge_ioapic_irq unmask_IO_APIC_irq
-
static void disable_edge_ioapic_irq (unsigned int irq) { /* nothing */ }
/*
return was_pending;
}
-#define shutdown_edge_ioapic_irq disable_edge_ioapic_irq
-
/*
* Once we have recorded IRQ_PENDING already, we can mask the
* interrupt for real. This prevents IRQ storms from unhandled
return 0; /* don't check for pending */
}
-#define shutdown_level_ioapic_irq mask_IO_APIC_irq
-#define enable_level_ioapic_irq unmask_IO_APIC_irq
-#define disable_level_ioapic_irq mask_IO_APIC_irq
-
static void end_level_ioapic_irq (unsigned int irq)
{
unsigned long v;
static void mask_and_ack_level_ioapic_irq (unsigned int irq) { /* nothing */ }
-/*
- * Level and edge triggered IO-APIC interrupts need different handling,
- * so we use two separate IRQ descriptors. Edge triggered IRQs can be
- * handled with the level-triggered descriptor, but that one has slightly
- * more overhead. Level-triggered interrupts cannot be handled with the
- * edge-triggered handler, without risking IRQ storms and other ugly
- * races.
- */
-
-static struct hw_interrupt_type ioapic_edge_irq_type = {
- "IO-APIC-edge",
- startup_edge_ioapic_irq,
- shutdown_edge_ioapic_irq,
- enable_edge_ioapic_irq,
- disable_edge_ioapic_irq,
- ack_edge_ioapic_irq,
- end_edge_ioapic_irq,
- set_ioapic_affinity,
-};
-
-static struct hw_interrupt_type ioapic_level_irq_type = {
- "IO-APIC-level",
- startup_level_ioapic_irq,
- shutdown_level_ioapic_irq,
- enable_level_ioapic_irq,
- disable_level_ioapic_irq,
- mask_and_ack_level_ioapic_irq,
- end_level_ioapic_irq,
- set_ioapic_affinity,
-};
-
static inline void init_IO_APIC_traps(void)
{
int irq;
extern void trap_init(void);
extern void init_IRQ(void);
extern void time_init(void);
- extern void softirq_init(void);
extern void timer_bh(void);
extern void init_timervecs(void);
extern void ac_timer_init(void);
#include <xeno/slab.h>
#include <xeno/delay.h>
#include <xeno/major.h>
-//#include <xeno/fs.h>
#include <xeno/blkpg.h>
#include <xeno/interrupt.h>
#include <xeno/timer.h>
-//#include <xeno/proc_fs.h>
#include <xeno/init.h>
#include <xeno/hdreg.h>
#include <xeno/spinlock.h>
#include <asm/uaccess.h>
#include <asm/io.h>
-//#include <xeno/smp_lock.h>
#include <xeno/blk.h>
#include <xeno/blkdev.h>
#include "cciss_cmd.h"
#include "cciss.h"
-//#include <xeno/cciss_ioctl.h>
/* define the PCI info for the cards we can control */
const struct pci_device_id cciss_pci_device_id[] = {
static ctlr_info_t *hba[MAX_CTLR];
static int map_major_to_ctlr[MAX_BLKDEV] = {0}; /* gets ctlr num from maj num */
-//static struct proc_dir_entry *proc_cciss;
static void do_cciss_request(request_queue_t *q);
static int cciss_open(struct inode *inode, struct file *filep);
static int revalidate_logvol(kdev_t dev, int maxusage);
static int frevalidate_logvol(kdev_t dev);
+#if 0
static int deregister_disk(int ctlr, int logvol);
static int register_new_disk(int cltr, int opened_vol, __u64 requested_lun);
static int cciss_rescan_disk(int cltr, int logvol);
+#endif
static void cciss_getgeometry(int cntl_num);
static struct block_device_operations cciss_fops = {
- //owner: THIS_MODULE,
open: cciss_open,
release: cciss_release,
ioctl: cciss_ioctl,
static int cciss_ioctl(struct inode *inode, struct file *filep,
unsigned int cmd, unsigned long arg)
{
+#if 0
//int ctlr = map_major_to_ctlr[MAJOR(inode->i_rdev)];
//int dsk = MINOR(inode->i_rdev) >> NWD_SHIFT;
+#endif
printk(KERN_ALERT "cciss_ioctl: Called BUT NOT SUPPORTED cmd=%x %lx\n", cmd, arg);
#endif /* CCISS_DEBUG */
return revalidate_logvol(dev, 0);
}
+#if 0
static int deregister_disk(int ctlr, int logvol)
{
unsigned long flags;
kfree(inq_buff);
return 0;
}
+#endif
+
/*
* Wait polling for a command to complete.
* The memory mapped FIFO is polled for the completion.
request_queue_t *q;
int i;
int j;
+#if 0
int rc;
+#endif
printk(KERN_DEBUG "cciss: Device 0x%x has been found at"
" bus %d dev %d func %d\n",
static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
unsigned long arg);
-int cdrom_get_last_written(kdev_t dev, long *last_written);
-int cdrom_get_next_writable(kdev_t dev, long *next_writable);
-
#ifdef CONFIG_SYSCTL
static void cdrom_sysctl_register(void);
#endif /* CONFIG_SYSCTL */
static void keyboard_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
- unsigned char status, scancode;
+ unsigned char status=0, scancode;
unsigned int work = 1000;
unsigned long cpu_mask = 0, flags;
struct task_struct *p = CONSOLE_OWNER;
#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
-extern ide_drive_t * get_info_ptr(kdev_t);
-extern unsigned long current_capacity (ide_drive_t *);
-
/*
* If heads is nonzero: find a translation with this many heads and S=63.
* Otherwise: find out how OnTrack Disk Manager would translate the disk.
static void mptscsih_dv_parms(MPT_SCSI_HOST *hd, DVPARAMETERS *dv,void *pPage);
static void mptscsih_fillbuf(char *buffer, int size, int index, int width);
#endif
-static int mptscsih_setup(char *str);
+/*static int mptscsih_setup(char *str);*/
static int mptscsih_halt(struct notifier_block *nb, ulong event, void *buf);
#if XENO_KILLED
}
#endif /* ~MPTSCSIH_DISABLE_DOMAIN_VALIDATION */
+#if 0
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/* Commandline Parsing routines and defines.
*
}
return 1;
}
-
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+#endif
};
#endif
-static int e100_ethtool_led_blink(struct net_device *, struct ifreq *);
-
#if 0
+static int e100_ethtool_led_blink(struct net_device *, struct ifreq *);
static int e100_mii_ioctl(struct net_device *, struct ifreq *, int);
#endif
}
#endif
+#if 0
#define E100_BLINK_INTERVAL (HZ/4)
/**
* e100_led_control
return 0;
}
+#endif
static inline int __devinit
e100_10BaseT_adapter(struct e100_private *bdp)
spin_unlock_irq(&tp->lock);
}
+#ifdef ETHTOOL
+
#define TG3_REGDUMP_LEN (32 * 1024)
static int tg3_get_regs_len(struct net_device *dev)
spin_unlock_irq(&tp->lock);
}
+#endif /* ETHTOOL */
+
static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct tg3 *tp = dev->priv;
return r;
}
+#ifdef ETHTOOL
+
static void tg3_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering)
{
struct tg3 *tp = dev->priv;
return 0;
}
+#endif /* ETHTOOL */
+
static u32 tg3_get_rx_csum(struct net_device *dev)
{
struct tg3 *tp = dev->priv;
void pnic2_lnk_change(struct net_device *dev, int csr5);
void pnic2_timer(unsigned long data);
void pnic2_start_nway(struct net_device *dev);
-void pnic2_lnk_change(struct net_device *dev, int csr5);
/* eeprom.c */
void tulip_parse_eeprom(struct net_device *dev);
return child;
}
-unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus);
-
/*
* If it's a bridge, configure it and scan the bus behind it.
* For CardBus bridges, we don't scan behind as the devices will
static boolean BusLogic_TargetDeviceInquiry(BusLogic_HostAdapter_T *) __init;
static void BusLogic_InitializeHostStructure(BusLogic_HostAdapter_T *,
SCSI_Host_T *) __init;
-int BusLogic_DetectHostAdapter(SCSI_Host_Template_T *) __init;
-int BusLogic_ReleaseHostAdapter(SCSI_Host_T *) __init;
static boolean BusLogic_ParseKeyword(char **, char *) __init;
#if 0 /* XEN */
static int BusLogic_ParseDriverOptions(char *) __init;
/* SAE */
#if XENO_KILLED
static void ahd_linux_sem_timeout(u_long arg);
-#endif
static int ahd_linux_queue_recovery_cmd(Scsi_Cmnd *cmd, scb_flag flag);
+#endif
static void ahd_linux_initialize_scsi_bus(struct ahd_softc *ahd);
static void ahd_linux_select_queue_depth(struct Scsi_Host *host,
sem = (struct semaphore *)arg;
up(sem);
}
-#endif
static int
ahd_linux_queue_recovery_cmd(Scsi_Cmnd *cmd, scb_flag flag)
spin_lock_irq(&io_request_lock);
return (retval);
}
+#endif /* XENO_KILLED */
static void
ahd_linux_dev_timed_unfreeze(u_long arg)
#ifndef _AIC79XX_LINUX_H_
#define _AIC79XX_LINUX_H_
+#include <xeno/config.h>
#include <xeno/types.h>
#include <xeno/blk.h>
#include <xeno/blkdev.h>
/*
* Always "return" 0 for success.
*/
-#define ahd_pci_set_dma_mask(dev_softc, mask) \
- (((dev_softc)->dma_mask = mask) && 0)
+static inline int ahd_pci_set_dma_mask(struct pci_dev *dev_softc, u64 mask)
+{
+ dev_softc->dma_mask = mask;
+ return 0;
+}
#endif
/*********************** Transaction Access Wrappers **************************/
static __inline void ahd_set_transaction_status(struct scb *, uint32_t);
#ifndef _CONSTANTS_H
#define _CONSTANTS_H
extern int print_msg(unsigned char *);
-extern void print_status(int);
extern void print_Scsi_Cmnd (Scsi_Cmnd *);
#endif /* def _CONSTANTS_H */
#endif
}
-
+#if XENO_KILLED_DELLOGDRV
static int
mega_do_del_logdrv(mega_host_config *this_hba, int logdrv)
{
return rval;
}
+#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
void *
static int mega_get_ldrv_num(mega_host_config *, Scsi_Cmnd *, int);
static int mega_support_random_del(mega_host_config *);
static int mega_del_logdrv(mega_host_config *, int);
-static int mega_do_del_logdrv(mega_host_config *, int);
+/*static int mega_do_del_logdrv(mega_host_config *, int);*/
#endif
"Enclosure ",
};
-/*
- * Function prototypes.
- */
-extern void scsi_times_out(Scsi_Cmnd * SCpnt);
-void scsi_build_commandblocks(Scsi_Device * SDpnt);
-
/*
* These are the interface to the old error handling code. It should go away
* someday soon.
int update_timeout(Scsi_Cmnd *, int);
extern void scsi_old_times_out(Scsi_Cmnd * SCpnt);
-extern int scsi_dispatch_cmd(Scsi_Cmnd * SCpnt);
-
#define SCSI_BLOCK(HOST) (HOST->can_queue && HOST->host_busy >= HOST->can_queue)
static unsigned char generic_sense[6] =
/*
* Externalize timers so that HBAs can safely start/restart commands.
*/
-extern void scsi_add_timer(Scsi_Cmnd *, int, void ((*) (Scsi_Cmnd *)));
-extern int scsi_delete_timer(Scsi_Cmnd *);
EXPORT_SYMBOL(scsi_add_timer);
EXPORT_SYMBOL(scsi_delete_timer);
/*
* These options are not tunable from 'make config'
*/
-#if 1
+#if 0
#define SYM_LINUX_PROC_INFO_SUPPORT
#define SYM_LINUX_BOOT_COMMAND_LINE_SUPPORT
#define SYM_LINUX_USER_COMMAND_SUPPORT
* Allow temporary mapping of domain page frames into Xen space.
*/
+#ifndef __ASM_DOMAIN_PAGE_H__
+#define __ASM_DOMAIN_PAGE_H__
+
#include <xeno/config.h>
#include <xeno/sched.h>
*/
extern void unmap_domain_mem(void *va);
-#if 0
-#define MAPCACHE_HASH(_pfn) ((_pfn) & (MAPCACHE_ENTRIES-1))
-static inline void *map_domain_mem(unsigned long pa)
-{
- unsigned long pfn = pa >> PAGE_SHIFT;
- unsigned long hash = MAPCACHE_HASH(pfn);
- unsigned long *pent = mapcache[smp_processor_id()] + hash;
- void *va = (void *)(MAPCACHE_VIRT_START +
- (hash << PAGE_SHIFT) +
- (pa & ~PAGE_MASK));
- if ( (*pent & PAGE_MASK) != (pfn << PAGE_SHIFT) )
- {
- *pent = (pfn << PAGE_SHIFT) | __PAGE_HYPERVISOR;
- __flush_tlb_one(va);
- }
- return va;
-}
-#endif
+#endif /* __ASM_DOMAIN_PAGE_H__ */
extern int quad_local_to_mp_bus_id [NR_CPUS/4][4];
extern unsigned int boot_cpu_physical_apicid;
-extern unsigned long phys_cpu_present_map;
extern int smp_found_config;
extern void find_smp_config (void);
extern void get_smp_config (void);
-extern int nr_ioapics;
extern int apic_version [MAX_APICS];
-extern int mp_irq_entries;
-extern struct mpc_config_intsrc *mp_irqs;
-extern int mpc_default_type;
extern int mp_current_pci_id;
extern unsigned long mp_lapic_addr;
-extern int pic_mode;
#endif
* General functions that each host system must provide.
*/
-extern void smp_boot_cpus(void);
extern void smp_store_cpu_info(int id); /* Store per CPU info (like the initial udelay numbers */
/*
#define SCSICAM_H
#include <xeno/kdev_t.h>
extern int scsicam_bios_param (Disk *disk, kdev_t dev, int *ip);
-extern int scsi_partsize(struct buffer_head *bh, unsigned long capacity,
- unsigned int *cyls, unsigned int *hds, unsigned int *secs);
#endif /* def SCSICAM_H */